// JavaScript Document
function checkAddProductForm() {
	with (window.document.frmAddProduct) {
		if (isEmpty(txtName, 'Introduceti numele produsului')) {
			return;
		} else if (isEmpty(txtPrice, 'Introduceti pretul in magazine')) {
			return;
		} else {
			submit();
		}
	}
}

function addProduct() {
	window.location.href = 'index.php?view=add';
}

function modifyProduct(productId) {
	window.location.href = 'index.php?view=modify&productId=' + productId;
}

function deleteProduct(productId) {
	if (confirm('Stergeti acest produs?')) {
		window.location.href = 'processProduct.php?action=deleteProduct&productId=' + productId;
	}
}

function deleteImage(productId) {
	if (confirm('Stergeti aceasta imagine?')) {
		window.location.href = 'processProduct.php?action=deleteImage&productId=' + productId;
	}
}

//###########Auction Functions###########

function checkAddAuctionForm() {
	with (window.document.frmAddAuction) {
		submit();
	}
}

function auctionWithProduct(productId) {
	window.location.href = 'index.php?view=addauction&productId=' + productId;
}
